package resource;

/**
 * Created by inuyasha on 18-3-22.
 */
public class ResourceLoader {
    final String CLASSPATH_URL_PREFIX = "classpath:";

    public Resource getResource(String location) {
        if (location.startsWith(CLASSPATH_URL_PREFIX)) {
            return new ClassPathResource(location.substring(CLASSPATH_URL_PREFIX.length()));
        } else {
            return new ClassPathResource(location);
        }
    }
}
